package com.antbee.cms.common.tools;

import java.io.Serializable;

public class ConfigEntity implements Serializable {
	   /** The cached hash code value for this instance.  Settting to 0 triggers re-calculation. */
    private int hashValue = 0;

    /** The composite primary key value. */
    private java.lang.Integer typeSeri;

    /** The value of the simple typeName property. */
    private java.lang.String typeCnName;
    
    /** The value of the simple typeName property. */
    private java.lang.String typeEnName;

    /**
     * Simple constructor of AbstractDicType instances.
     */
    public ConfigEntity()
    {
    }

    /**
     * Constructor of AbstractDicType instances given a simple primary key.
     * @param typeSeri
     */
    public ConfigEntity(java.lang.Integer typeSeri)
    {
        this.setTypeSeri(typeSeri);
    }

    /**
     * Return the simple primary key value that identifies this object.
     * @return java.lang.Integer
     */
    public java.lang.Integer getTypeSeri()
    {
        return typeSeri;
    }

    /**
     * Set the simple primary key value that identifies this object.
     * @param typeSeri
     */
    public void setTypeSeri(java.lang.Integer typeSeri)
    {
        this.hashValue = 0;
        this.typeSeri = typeSeri;
    }

    /**
     * Return the value of the TYPE_NAME column.
     * @return java.lang.String
     */
    public java.lang.String getTypeCnName()
    {
        return this.typeCnName;
    }

    /**
     * Set the value of the TYPE_NAME column.
     * @param typeName
     */
    public void setTypeCnName(java.lang.String typeCnName)
    {
        this.typeCnName = typeCnName;
    }   

    /**
     * Return the value of the TYPE_NAME column.
     * @return java.lang.String
     */
    public java.lang.String getTypeEnName()
    {
        return this.typeEnName;
    }

    /**
     * Set the value of the TYPE_NAME column.
     * @param typeName
     */
    public void setTypeEnName(java.lang.String typeEnName)
    {
        this.typeEnName = typeEnName;
    } 
    
    /**
     * Implementation of the equals comparison on the basis of equality of the primary key values.
     * @param rhs
     * @return boolean
     */
    public boolean equals(Object rhs)
    {
        if (rhs == null)
            return false;
        if (! (rhs instanceof ConfigEntity))
            return false;
        ConfigEntity that = (ConfigEntity) rhs;
        if (this.getTypeSeri() == null || that.getTypeSeri() == null)
            return false;
        return (this.getTypeSeri().equals(that.getTypeSeri()));
    }

    /**
     * Implementation of the hashCode method conforming to the Bloch pattern with
     * the exception of array properties (these are very unlikely primary key types).
     * @return int
     */
    public int hashCode()
    {
        if (this.hashValue == 0)
        {
            int result = 17;
            int typeSeriValue = this.getTypeSeri() == null ? 0 : this.getTypeSeri().hashCode();
            result = result * 37 + typeSeriValue;
            this.hashValue = result;
        }
        return this.hashValue;
    }
}
